/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author USER
 */
@Entity
@Table(name = "bilet")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Bilet.findAll", query = "SELECT b FROM Bilet b"),
    @NamedQuery(name = "Bilet.findByIdBilet", query = "SELECT b FROM Bilet b WHERE b.idBilet = :idBilet"),
    @NamedQuery(name = "Bilet.findByUcret", query = "SELECT b FROM Bilet b WHERE b.ucret = :ucret")})
public class Bilet implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idBilet")
    private Integer idBilet;
    @Basic(optional = false)
    @Column(name = "ucret")
    private double ucret;
    @JoinColumn(name = "seansId", referencedColumnName = "idSeans")
    @ManyToOne(optional = false)
    private Seans seansId;
    @JoinColumn(name = "seyirciId", referencedColumnName = "idSeyirci")
    @ManyToOne(optional = false)
    private Seyirci seyirciId;

    public Bilet() {
    }

    public Bilet(Integer idBilet) {
        this.idBilet = idBilet;
    }

    public Bilet(Integer idBilet, double ucret) {
        this.idBilet = idBilet;
        this.ucret = ucret;
    }

    public Integer getIdBilet() {
        return idBilet;
    }

    public void setIdBilet(Integer idBilet) {
        this.idBilet = idBilet;
    }

    public double getUcret() {
        return ucret;
    }

    public void setUcret(double ucret) {
        this.ucret = ucret;
    }

    public Seans getSeansId() {
        return seansId;
    }

    public void setSeansId(Seans seansId) {
        this.seansId = seansId;
    }

    public Seyirci getSeyirciId() {
        return seyirciId;
    }

    public void setSeyirciId(Seyirci seyirciId) {
        this.seyirciId = seyirciId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idBilet != null ? idBilet.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Bilet)) {
            return false;
        }
        Bilet other = (Bilet) object;
        if ((this.idBilet == null && other.idBilet != null) || (this.idBilet != null && !this.idBilet.equals(other.idBilet))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Bilet[ idBilet=" + idBilet + " ]";
    }
    
}
